import { Body, Controller, Post } from '@nestjs/common';
import { ToolsService } from 'src/utils/tools.service';
import { QiniuService } from './qiniu.service';

@Controller('components/qiniu')
export class QiniuController {
  constructor(private readonly qiniuService: QiniuService) {}

  @Post('/remove')
  removeQiniu(@Body() body: { key: string }) {
    try {
      return this.qiniuService.removeQiniu(body.key);
    } catch (error) {
      ToolsService.fail(error);
    }
  }
}
